package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.BusinessProcess;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/BusinessProcessMapper.class */
public interface BusinessProcessMapper {
    @ResultMap({"map"})
    @Select({"select *  from  business_process where id = #{id}"})
    BusinessProcess queryById(Integer num);

    @Results(id = "map", value = {
            @Result(property = "businessProcessMainId", column = "business_process_main_id"),
            @Result(property = "addUrl", column = "add_url"),
            @Result(property = "theOrder", column = "the_order")})
    @Select({"<script>" +
            "select *  from business_process <where> " +
            "<if test='businessProcessMain != null '>business_process_main_id=#{businessProcessMain} </if>" +
            "</where> " +
            "</script>"})
    List<BusinessProcess> queryAll(Integer num);

    @Insert({"insert into business_process(business_process_main_id,url,icon,the_order,name,add_url)" +
            "values(#{businessProcessMainId},#{url},#{icon},#{theOrder},#{name},#{addUrl})"})
    int insert(BusinessProcess businessProcess);

    @Delete({"delete from business_process where id = #{id}"})
    int deleteById(Integer num);

    @Delete({"delete from business_process where business_process_main_id = #{businessProcessMainId}"})
    int deleteByProcessMainId(Integer num);

    @Update({"<script>" +
            "update business_process <set>" +
            "<if test='businessProcessMainId != null '> business_process_main_id = #{businessProcessMainId},</if>" +
            "<if test='url != null and url.length &gt; 0'> url = #{url},</if>" +
            "<if test='icon != null and icon.length &gt; 0'> icon = #{icon},</if>" +
            "<if test='theOrder != null '> the_order = #{theOrder},</if>" +
            "<if test='name != null '> name = #{name},</if>" +
            "<if test='addUrl != null and addUrl.length &gt; 0'> add_url = #{addUrl},</if>" +
            "</set>where id = #{id}" +
            "</script>"})
    int update(BusinessProcess businessProcess);
}